#define _CRT_SECURE_NO_WARNINGS 1

#include"list.h"

void text1()
{
	ListNode* head = (ListNode*)malloc(sizeof(ListNode));
	head->next = head;
	head->prev = head;

	ListPushBack(head, 1);
	ListPushBack(head, 2);
	ListPushBack(head, 3);
	ListPushBack(head, 4);
	ListPushBack(head, 5);

	ListPrint(head);

	ListPopBack(head);
	ListPopBack(head);
	ListPopBack(head);

	ListPrint(head);

	ListPushFront(head, 6);
	ListPushFront(head, 7);
	ListPushFront(head, 8);
	ListPushFront(head, 9);

	ListPrint(head);

	ListPopFront(head);
	ListPopFront(head);


	ListPrint(head);

	ListNode* del1 = ListFind(head, 6);
	ListInsert(del1, 6);
	ListNode* del2 = ListFind(head, 2);
	ListInsert(del2, 1);
	ListPrint(head);

	del1 = ListFind(head, 6);
	ListErase(del1);
	del2 = ListFind(head, 2);
	ListErase(del2);

	ListPrint(head);

	ListDestory(head);
	ListPrint(head);
}

int main()
{
	text1();
	return 0;
}